<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('think', function () {
    return 'hello,ThinkPHP6!';
});

Route::get('hello/:name', 'index/hello')->allowCrossDomain(['Vary'=>'Origin']);

Route::get('hello2/:name', 'index/hello2')->allowCrossDomain(['Vary'=>'Origin']);

/*----登录权限相关操作----*/

Route::any('wl/sys/userLogin', 'UsersController/login')->allowCrossDomain();
Route::any('wl/sys/userMenuList', 'AuthApiController/getFirstMenus')->allowCrossDomain();
Route::any('wl/sys/getMenuList', 'AuthApiController/getMenuList')->allowCrossDomain();
Route::any('wl/sys/info', 'AuthApiController/loginInfo')->allowCrossDomain();
/*----登录权限相关操作-end----*/

/*用户登录的功能*/
Route::get('wl/user/checkAccount','UsersController/checkAccount')->append(['table'=>'user'])->allowCrossDomain(['Vary'=>'Origin']);
Route::any('wl/user/register','UsersController/saveData')->append(['table'=>'user'])->allowCrossDomain(['Vary'=>'Origin']);
Route::any('wl/user/changePwd','UsersController/changePwd')->append(['table'=>'user'])->allowCrossDomain(['Vary'=>'Origin']);
//--图片验证码
Route::any('wl/user/verify','UsersController/verify')->allowCrossDomain(['Vary'=>'Origin']);
//--发送验证码
Route::any('wl/user/sendMsg','UsersController/sendMsg')->allowCrossDomain(['Vary'=>'Origin']);
//用户支付
Route::any('wl/user/userCreateOrder','UsersController/userCreateOrder')->allowCrossDomain(['Vary'=>'Origin']);
Route::any('wl/user/payCallBack','CommonPayController/payCallBack')->allowCrossDomain(['Vary'=>'Origin']);
Route::any('wl/user/aliCallBack','CommonPayController/aliCallBack')->allowCrossDomain(['Vary'=>'Origin']);
//判断订单是否支付成功
Route::any('wl/user/checkOrderStatus','UsersController/checkOrderStatus')->allowCrossDomain(['Vary'=>'Origin']);
//--定时任务轮训订单
Route::any('wl/user/runOrderUsed','UsersController/runOrderUsed')->allowCrossDomain(['Vary'=>'Origin']);
//获取用户订单信息
Route::any('wl/user/getUserBuyList','UsersController/getUserBuyList')->allowCrossDomain(['Vary'=>'Origin']);
//用户修改密码
Route::any('wl/user/userChangePwd','UsersController/userChangePwd')->allowCrossDomain(['Vary'=>'Origin']);
// 获取所有套餐列表
Route::any('wl/user/getComboList','UsersController/getComboList')->allowCrossDomain(['Vary'=>'Origin']);
//总共可以添加多少数量用户
Route::any('wl/user/getCountChild','UsersController/getCountChild')->allowCrossDomain(['Vary'=>'Origin']);
//--定时任务
Route::any('wl/user/userOrderAddTime','\app\logic\OrderLogic@userOrderAddTime')->allowCrossDomain(['Vary'=>'Origin']);

Route::any('wl/user/getCacheDump','CommonPayController/getCacheDump')->allowCrossDomain(['Vary'=>'Origin']);
//上传图片
Route::any('wl/user/uploadFiles','UsersController/uploadFiles')->allowCrossDomain(['Vary'=>'Origin']);
/*---end----*/


/*----google接口功能----*/
Route::any('wl/google/templateList', 'TemplateController/index')->allowCrossDomain();
//--添加查询日志接口
Route::any('wl/google/addSearchLog', 'TemplateController/addSearchLog')->allowCrossDomain();
Route::any('wl/google/mock', 'TemplateController/mock')->allowCrossDomain();
Route::any('wl/google/createRand', 'TemplateController/createRand')->allowCrossDomain();


Route::resource('wl/google/template','resource_controller')->append(['table'=>'lyx_template']);
Route::resource('wl/google/user','resource_user_controller')->append(['table'=>'lyx_user']);
Route::resource('wl/google/order','resource_order_controller')->append(['table'=>'lyx_order']);
Route::resource('wl/google/msg','resource_controller')->append(['table'=>'lyx_msg']);
Route::resource('wl/google/searchLog','resource_controller')->append(['table'=>'lyx_search_log']);
Route::resource('wl/google/combo','resource_controller')->append(['table'=>'lyx_combo']);


/*----google end----*/

/*自动生成相关*/

//-创建列表模版相关操作
Route::any('wl/table/filtration', 'CreateTableController/tableFiltration')->allowCrossDomain();

//保存分类接口
Route::any('wl/table/saveCategory', 'CreateTableController/saveCategory')->allowCrossDomain();
//分类列表
Route::any('wl/table/getCategoryList', 'CreateTableController/getCategoryList')->allowCrossDomain();
//table列表数据
Route::any('wl/table/getTableList', 'CreateTableController/getTableList')->allowCrossDomain();
//--数据库下的所有表
Route::any('wl/table/getDataBaseList', 'CreateTableController/getDataBaseList')->allowCrossDomain();
//--数据表的详细信息
Route::any('wl/table/getTableInfoList', 'CreateTableController/getTableInfoList')->allowCrossDomain();
//--编辑表格获取数据
Route::any('wl/table/getEditTableInfo', 'CreateTableController/getEditTableInfo')->allowCrossDomain();


Route::any('wl/table/test', 'CreateTableController/test')->allowCrossDomain();//测试

/***--web端api相关接口--***/

//--web获取表格头部数据接口
Route::any('wl/table/getTableColumnList/:center_id/:cat_id/:appid', 'CreateTableController/getTableColumnList')->allowCrossDomain();
//--获取列表数据
Route::any('wl/table/apiGetTableList/:center_id/:cat_id/:appid', 'CreateTableController/apiGetTableList')->allowCrossDomain();
//--生成表单的数据
Route::any('wl/table/getFormFiltrationData/:center_id/:cat_id/:appid', 'CreateTableController/getFormFiltrationData')->allowCrossDomain();
//--保存或者新增表单数据
Route::any('wl/table/saveFormData/:center_id/:cat_id/:appid', 'CreateTableController/saveFormData')->allowCrossDomain();
//--获取表单的编辑数据
Route::any('wl/table/getFormEditData/:center_id/:cat_id/:appid', 'CreateTableController/getFormEditData')->allowCrossDomain();
//--删除表单数据
Route::any('wl/table/delFormIdData/:center_id/:cat_id/:appid', 'CreateTableController/delFormIdData')->allowCrossDomain();




/*-----end----*/

